.TH std::experimental::reflect::get_source_line 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::reflect::get_source_line \- std::experimental::reflect::get_source_line

.SH Synopsis
   Defined in header <experimental/reflect>
   template< Object T >                      (reflection TS)
   struct get_source_line;

   Provides the member constant value equal to the presumed line number of the
   declaration of the entity or typedef-name reflected by T.

.SH Member constants

   value    the presumed line number of the declaration of the entity or typedef-name
   \fB[static]\fP reflected by T
            \fI(public static member constant)\fP

.SH Member functions

                                converts the object to std::uint_least32_t, returns
   operator std::uint_least32_t value
                                \fI(public member function)\fP
   operator()                   returns value
   \fI(C++14)\fP                      \fI(public member function)\fP

.SH Member types

   Type       Definition
   value_type std::uint_least32_t
   type       std::integral_constant<std::uint_least32_t, value>

.SH Example

   The following code shows the source code line of an object or a class.


// Run this code

 #include<experimental/reflect>
 #include<iostream>

 using refl = std::experimental::reflect;

 float f;
 struct P{};

 int main()
 {
     std::cout << refl::get_source_line_v<reflexpr(f)> << '\\n';
     std::cout << refl::get_source_line_v<reflexpr(P)> << '\\n';
 }

.SH Output:

 6
 7

.SH See also

   line        return the line number represented by this object
               \fI(public member function of std::source_location)\fP
   source_line gets the line number that lexically relates the evaluation represented
   (C++23)     by the stacktrace_entry
               \fI(public member function of std::stacktrace_entry)\fP
